package com.qf.controller;

import com.qf.entity.User;
import com.qf.service.UserService;
import com.qf.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
public class Demo3Controller {
    @Autowired
    private UserService userService;
    @GetMapping("/user/search/v2")
    public R userSearchByMap(@RequestParam HashMap<String,String> map){
        System.out.println(map);
        List<User> list=userService.SearchUserByMap(map);
        return R.success(list);
    }
    @GetMapping("/user/delete/v2")
    public R deleteByIds(@RequestParam List<Integer> ids){
       boolean isok= userService.deleteByIds(ids);
        return R.success(isok);
    }
    @GetMapping("/user/update/v2")
    public R updateUserBySet(User user){
        userService.updateUserBySet(user);
        return R.success();
    }

}
